home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 25
/
Cream of the Crop 25.iso
/
bbs
/
doorinfo.zip
/
LOADTLCF.C
< prev
next >
Wrap
C/C++ Source or Header
|
1997-05-14
|
2KB
|
72 lines
/*
** This is the loader program for the tlcfdemo door, which is just a way
** of demonstrating multi-player doors in Falken.
**
** This sample implements the classic approach of having a small 'loader'
** program which loads and executes the real door, the suspends itself.
** When the player exits the real door, this program is awakened, and
** exits. Falken sees the exit, and puts the user back at the main menu.
**
*/
#include "stdio.h"
#include "doorutil.h"
main(int argc, char *argv[])
{
int j;
/*
** Basic Falken doors initialization
*/
init();
/*
** the real door (tlcfdemo.exe) looks for the name 'tlcfdemo' in the
** doors_id field of the user record.
*/
strcpy(myuser->doors_id, "tlcfdemo");
/*
** if 'tlcfdemo.exe' has not yet been loaded, we have to do it.
** if it has, then it will see the new player in it's normal
** processing loop.
*/
hog(); /* we need to stop multitasking momentarily */
j=check_tcb_names("tlcfdemo");
nohog();
if (j==0) /* main prog not loaded yet! */
{
/*
** since tlcfdemo.exe is not yet active, we will load it.
** the load_a_door function will load it, run it, and send
** an initialization event to it. We use priority 5 which is
** low enough to let everything run.
*/
if (load_a_door("tlcfdemo.exe", 5) < 0)
{
qprintf("Cannot load TLCFDEMO!\r\r");
delay(2);
exit(0);
}
}
/*
** the tlcfdemo door is now active, one way or another.
** we suspend, until it issues a wakeup() for us.
*/
suspend();
/*
** we got woke up. time to leave.
*/
exit(0); /* when we wake up - we die! */
}